package com.webchat.rmi.ugc;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.domain.vo.request.MomentSaveOrUpdateVO;
import com.webchat.domain.vo.response.moment.MomentDetailVO;
import com.webchat.rmi.interceptor.RpcRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(name = "webchat-ugc-service",
        contextId = "momentClient",
        configuration = RpcRequestInterceptor.class)
public interface MomentClient {

    /**
     * 动态发布API
     *
     * @param momentSaveOrUpdate
     * @return
     */
    @PostMapping("/ugc-service/moment/publish")
    APIResponseBean<Long> publish(@RequestBody MomentSaveOrUpdateVO momentSaveOrUpdate);


    /**
     * 朋友圈动态数据瀑布流翻页加载
     *
     * @param userId
     * @param lastMomentId
     * @param size
     * @return
     */
    @GetMapping("/ugc-service/moment/timeline")
    APIResponseBean<List<MomentDetailVO>> timeline(@RequestParam String userId,
                                                   @RequestParam Long lastMomentId,
                                                   @RequestParam Integer size);
}
